package com.ruitu.health_1.ui;

import android.os.Bundle;
import android.widget.TextView;

import com.ruitu.arad.base.BaseActivity;
import com.ruitu.health_1.R;
import com.ruitu.health_1.mvp.model.UserInfoModel;
import com.ruitu.health_1.mvp.presenter.UserInfoPresent;
import com.ruitu.router_module.AppHolder;
import com.ruitu.router_module.bean.user.Wallet;

public class WalletActivity extends BaseActivity<UserInfoPresent.WalletP, UserInfoModel.WalletM> {
    private TextView tv_integral;
    private TextView tv_balance;

    @Override
    protected int getLayoutRes() {
        return R.layout.activity_wallet;
    }

    @Override
    protected void initViews() {
        super.initViews();
        setHeadTitle("我的钱包");
        tv_integral = findViewById(R.id.tv_integral);
        tv_balance = findViewById(R.id.tv_balance);
        String userId = AppHolder.instance().getUser().getId();
        showProgress();
        p.walletInfo(userId, "0");
    }

    public void getWalletInfo(Wallet wallet) {
        tv_integral.setText(wallet.getBuyPoint());
        tv_balance.setText(wallet.getBuyerMoney());
    }
}
